package dispinfo;

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;

public class DispInfoCanvas extends Canvas
{
	private Provider currentProvider = null;
	

	protected void paint(Graphics g)
	{
		Provider provider = getProvider();
		
		g.setColor(0xFFFFFF);
		
		int width = getWidth();
		int height = g.getClipHeight();
		g.fillRect(0, 0, width, height);
		if (provider == null) return;
		
		g.setColor(0x000000);
		provider.paint(g, width, height);
	}
	
	synchronized public void setProvider(Provider provider)
	{
		currentProvider = provider;
	}
	
	synchronized public Provider getProvider()
	{
		return currentProvider;
	}

}
